<?php

namespace PHD;

class Config {

    static private $_instance = NULL;

    static private $_config = NULL;

    public static function getInstance() {

        if ( is_null(self::$_instance) )
            self::$_instance = new self;

        return self::$_instance;

    }

    private function __construct() {

        if ( is_null(self::$_config) )
            self::$_config = parse_ini_file(ROOT . '/etc/phd.conf');

    }

    public function __get($name) {

        if ( isset(self::$_config[$name]) )
            return self::$_config[$name];

        return false;

    }

}